package www.sofn.com.shopping.cart.domain.pojo;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.ToString;
import lombok.experimental.Accessors;
import www.sofn.com.domain.pojo.BasePO;
import www.sofn.com.shopping.cart.handler.AttrInfoFieldTypeHandler;

import java.util.List;

@Data
@Accessors(chain = true)
@TableName(value = "shopping_cart", autoResultMap = true)
public class ShoppingCartPO  extends BasePO {
    @TableField(updateStrategy = FieldStrategy.NEVER)
    private Long goodsId;//商品Id
    @TableField(typeHandler = AttrInfoFieldTypeHandler.class,javaType = true )
    private List<ShoppingCartPO.AttrInfo> AttrInfos;//规格信息
    @TableField(updateStrategy = FieldStrategy.NEVER)
    private Long memberId; //会员Id

    @Data
    @Accessors(chain = true)
    @ToString
    public static class AttrInfo{
        private String id;
        private Integer num;
    }

}



